<template>
  <div class="container">
    <!-- 商品显示区域 -->
    <div class="content">
      <!-- 爱吃专场 -->
      <div class="item-class">
        <div class="item-class-head item-class-eat-head">
          <span class="item-class-title">{{ pointShop.title }}</span>
        </div>
        <div class="item-class-content" v-for="(item, index) in pointShop.detail" :key="index">
          <div class="item-content-top">
            <div class="item-four-img">
              <div class="item-four-detail" v-for="(subItem, index) in item.itemFour" :key="index">
                <div class="item-four-detail-img ">
                  <a href="/" class="portfolio_item">
                    <img :src="subItem.img" alt="image" class="img-responsive"/>
                    <div class="portfolio_item_hover">
                      <div class="portfolio-border">
                        <div class="item_info">
                          <span v-text="subItem.title"></span>
                          <em>立即兑换</em>
                        </div>
                      </div>
                    </div>
                  </a>
                </div>
                <div class="item-four-detail-text">
                  <p class="pt_bi_tit pt_bi_tit-eat">{{ subItem.title }}</p>
                  <p class="pt_bi_promo">{{ subItem.intro }}</p>
                  <div class="goods-price-wrapper">
                    <span class="goods-price text-danger">{{ subItem.price }} 积分</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
  </div>
</template>

<script>
import HomeNav from '@/components/nav/HomeNav';
import store from '@/vuex/store';
import {mapState, mapActions} from 'vuex';

export default {
  name: 'Index',
  created () {
    this.loadCarouselItems();
    this.loadPointShop();
    this.loadShoppingCart();
  },
  mounted () {
    const father = this;
    this.setIntervalObj = setInterval(function () {
      father.REDUCE_SECKILLS_TIME();
    }, 1000);
  },
  data () {
    return {
      setIntervalObj: null
    };
  },
  methods: {
    ...mapActions(['loadCarouselItems', 'loadPointShop', 'loadShoppingCart'])
  },
  computed: {
    ...mapState(['pointShop'])
  },
  components: {
    HomeNav
  },
  destroyed () {
    clearInterval(this.setIntervalObj);
  },
  store
};
</script>

<style scoped>
.container {
  background-color: #ffffff;
  background-image: url("/static/img/index/background.png");
  background-repeat: repeat;
  padding-bottom: 100px;
}

.content {
  width: 1008px;
  margin: 0px auto;
}

.goods-price-wrapper {
  margin-top: 50px;
  margin-right: 40px;
  float: right;
}

.goods-price {
  margin-right: 5px;
  font-size: 25px;
  font-weight: bold;
  color: rgb(0, 150, 136);
}
/*****************************商品专栏开始*****************************/
.item-class {
  width: 100%;
  height: 1200px;
  margin-top: 15px;
}

.item-class-head {
  width: 100%;
  height: 50px;
  background-color: #4488a7;
}

.item-class-eat-head {
  background-color: #f5cb1a;
}

.item-class-head ul {
  list-style: none;
  float: right;
  margin-right: 30px;
  line-height: 50px;
}

.item-class-head a {
  padding: 6px;
  margin-left: 15px;
  font-size: 12px;
  background-color: #6da6be;
  border: 1px solid #6da6be;
  text-decoration: none;
  color: #fff;
}

.item-class-eat-head a {
  background-color: #eeb955;
  border: 1px solid #eeb955;
}

.item-class-head a:hover {
  border: 1px solid #fff;
}

.item-class-head li {
  float: left;
}

.item-class-title {
  font-size: 25px;
  line-height: 50px;
  color: #fff;
  margin-left: 15px;
}

.item-class-content {
  width: 49%;
  cursor: pointer;
  margin-left: 0.9%;
  /*background-color: #cff;*/
  float: left;

}

.item-class-content:nth-child(odd) {
  border: none;
}

.item-content-top {
  width: 100%;
  height: 1200px;
}

.item-four-img {
  width: 100%;
  margin-left: 8px;
  float: left;
}

.item-four-detail img {
  margin-left: 0px;
  transition: margin-left 0.3s;
}

.item-four-detail:hover img {
  margin-left: -6px;
  transition: margin-left 0.3s;
}

.item-four-detail {
  width: 100%;
  height: 300px;
  margin-left: -1px;
  float: left;
}

.item-four-detail-text {
  margin-left: 5px;
  margin-top: 25px;
  width: 180px;
  float: right;
}

.item-four-detail-img {
  width: 300px;
  margin-top: 15px;
  overflow: hidden;
  float: left;
  display: block;
}

.item-four-detail-img img {
  margin-left: 5px;
  width: 300px;
}

.pt_bi_tit {
  font-weight: bold;
  font-family: 黑体;
  font-size: 26px;
  color: #4488a7;
}

.pt_bi_tit-eat {
  color: #ecb127;
}

.pt_bi_promo {
  color: #00695c;
  font-weight: bold;
  font-family: 华文仿宋;
  font-size: 16px;
}

.item-content-bottom {
  width: 100%;
  margin-top: 8px;
}

.item-content-bottom-img {
  width: 156px;
  margin-right: 8px;
  overflow: hidden;
  float: left;
}

.item-content-bottom-img img {
  margin-left: 0px;
  transition: margin-left 0.3s;
}

.item-content-bottom-img:hover img {
  margin-left: -15px;
  transition: margin-left 0.3s;
}

/* portfolio section
==================================================*/

.portfolio .categories-grid span {
  font-size: 30px;
  margin-bottom: 30px;
  display: inline-block;
}

.portfolio .categories-grid .categories ul li {
  list-style: none;
  margin: 20px 0;
}

.portfolio .categories-grid .categories ul li a {
  display: inline-block;
  color: #60606e;
  padding: 0 10px;
  margin: 0 10px;
  -webkit-transition: all .2s ease-in-out .2s;
  transition: all .2s ease-in-out .2s;
}

.portfolio .categories-grid .categories ul li a:hover,
.portfolio .categories-grid .categories ul li a:focus {
  text-decoration: none;
}

.portfolio .categories-grid .categories ul li a.active {
  margin-left: 0;
  background-color: #ffbf00;
  padding: 0px 20px;
  color: white;
  border-radius: 25px;
  text-decoration: none;
}

.portfolio_filter {
  padding-left: 0;
}

.portfolio_item {
  position: relative;
  overflow: hidden;
  display: block;
}

.portfolio_item .portfolio_item_hover {
  position: absolute;
  top: 0px;
  left: 0px;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, .8);
  -webkit-transform: translate(-100%);
  transform: translate(-100%);
  opacity: 0;
  -webkit-transition: all .2s ease-in-out;
  transition: all .2s ease-in-out;
}

.portfolio_item .portfolio_item_hover .item_info {
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  padding: 10px;
  width: 100%;
  font-weight: bold;
}

.portfolio_item .portfolio_item_hover .item_info span {
  display: block;
  color: #fff;
  font-size: 26px;
  -webkit-transform: translateX(-100px);
  transform: translateX(-100px);
  -webkit-transition: all .2s ease-in-out .2s;
  transition: all .2s ease-in-out .2s;
  opacity: 0;
}

.portfolio_item .portfolio_item_hover .item_info em {
  font-style: normal;
  display: inline-block;
  background-color: #ffbf00;
  padding: 10px 50px;
  border-radius: 20px;
  color: #333;
  margin-top: 10px;
  -webkit-transform: translateX(-100px);
  transform: translateX(-100px);
  -webkit-transition: all .3s ease-in-out .3s;
  transition: all .3s ease-in-out .3s;
  opacity: 0;
  font-size: 16px;
  letter-spacing: 2px;
}

.portfolio_item:hover .portfolio_item_hover {
  opacity: 1;
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

.portfolio_item:hover .item_info em,
.portfolio_item:hover .item_info span {
  opacity: 1;
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

.portfolio .categories-grid .categories ul li {
  float: left;
}

.portfolio .categories-grid .categories ul li a {
  padding: 0 10px;
  -webkit-transition: all .2s ease-in-out .2s;
  transition: all .2s ease-in-out .2s;
}

.portfolio_filter {
  padding-left: 0;
  display: inline-block;
  margin: 0 auto;
  text-align: center;
  margin-bottom: 50px;
}

.portfolio-inner {
  padding-bottom: 0 !important;
  padding-top: 55px;
}

/*****************************商品专栏结束*****************************/
</style>
